#define _CRT_SECURE_NO_WARNINGS 1
#include <climits>
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int T = 0;
    cin >> T;
    while (T--)
    {
        long long n = 0, a = 0, b = 0;
        cin >> n >> a >> b;
        cerr << "n=" << n << ",a=" << a << ",b=" << b << endl;
        // int cheap=a,exp=b;
        // if(a/2>b/3)
        // {
        //     cheap=b;
        //     exp=a;
        // }
        long long pricea = n / 2 * a;
        if (n % 2 != 0) pricea += a;

        long long priceb = n / 3 * b;
        if (n % 3 != 0) priceb += b;
        cerr << "pricea=" << pricea << ",priceb=" << priceb << endl;
        cout << min(priceb, pricea) << endl;
    }
}